📋 Challenge Description
You've discovered a comment section that doesn't properly sanitize user input. The application is vulnerable to Cross-Site Scripting (XSS) attacks. Your task is to craft an XSS payload that triggers an alert containing the flag.
Objective: Inject JavaScript code to execute and reveal the hidden flag.
📖 XSS Attack Information:
XSS Types: Stored XSS (persists in database), Reflected XSS (in URL), DOM-based XSS
This Challenge: Stored XSS - your comment is stored and displayed to all users
Vulnerability: User input is inserted directly into HTML without sanitization
Goal: Inject JavaScript that executes when the comment is displayed
💡 Exploitation Hints:
1. Basic XSS: Try injecting a simple script tag: <script>alert('XSS')</script>
2. Flag Location: The flag is stored in a global JavaScript variable called "secretFlag"
3. Access Variable: Use window.secretFlag or just secretFlag to access it
4. Complete Payload: <script>alert(secretFlag)</script>
5. Alternative: Try: <img src=x onerror="alert(secretFlag)">
6. Testing: After posting, the injected script should execute automatically
7. Ask a Chatbot: "How do I create an XSS payload to access a JavaScript variable?"
Recent Comments: